<?php
/**
 * @package Spider Contacts
 * @author Web-Dorado
 * @copyright (C) 2012 Web-Dorado. All rights reserved.
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 **/
 
defined('_JEXEC') or die('Restricted access');
class HTML_spidercontacts
  {
    function showLinks($option, $controller)
      {
?>
<div style="background-color:#f6f6f6"> 
<table>
<tr>
<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=category"><img src="components/com_spidercontacts/images/Categories.png"  ALT="Categories"  style="padding:12px;"   width=100><br>Categories</a>
</td>
<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=contacts"><img src="components/com_spidercontacts/images/products.png"  ALT="Contacts"  style="padding:12px;"  width=100><br>Contacts</a>
</td>

<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=options"><img src="components/com_spidercontacts/images/options.png"  ALT="Options"  style="padding:12px;"   width=100><br>Options</a>
</td>
<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=messages"><img src="components/com_spidercontacts/images/Messages.png"  ALT="Messages"  style="padding:12px;"   width=100><br>Messages</a>
</td>


</tr>
</table>

</div >
<?php
      }
    function editContact( $row, $lists, $option , $params, $rows1)

{
echo '<style>fieldset label,
fieldset span.faux-label
{
	float:none;
	display:inline;
	}
	fieldset input, fieldset textarea, fieldset select, fieldset img, fieldset button
	{
		float:none;
		}</style>';


$editor =& JFactory::getEditor();



JHTML::_('behavior.calendar');



JHTML::_('behavior.modal'); 

?>



<form  action="index.php" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<legend>Details</legend>

<script type="text/javascript">
Joomla.submitbutton = function(pressbutton) 
{


function checkEmail() {
var email = document.getElementById('email');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (email.value == '')
return true;

else if (!filter.test(email.value)) {
alert('Please provide a valid email address');
email.focus;
return false;
}

else return true;
}
var check = checkEmail();
var checkname = 0;
var checklname = 0;
if ( pressbutton!='cancel' && check)
{
	if(!document.adminForm.first_name.value=='')
	{
		checkname = 1;
		}
	else{
		alert('First Name is required.');
		document.adminForm.first_name.focus();
	}
					if(!document.adminForm.last_name.value=='' )
					{checklname = 1;}
					else
				{
					alert('Last Name is required.');
					document.adminForm.last_name.focus();
					
				}
		
	
	}
	
	
	
	 if (checkname == 1 && checklname == 1 && check )
		submitform(pressbutton);


	

if ( pressbutton=='cancel')
	{
		submitform(pressbutton);
}
}
</script>


<table class="admintable">



<tr>



<td width="100" align="right" class="key">



First Name:



</td>



<td>



<input class="text_area" type="text" name="first_name" 



id="first_name" size="50" maxlength="250"



value="<?php echo htmlspecialchars($row->first_name);?>" />



</td>



</tr>

<tr>



<td width="100" align="right" class="key">



Last Name:



</td>



<td>



<input class="text_area" type="text" name="last_name" id="last_name" size="50" maxlength="250"



value="<?php echo htmlspecialchars($row->last_name);?>" />



</td>




</tr>


<tr>



<td width="100" align="right" class="key">



Email:


</td>



<td>



<input  class="text_area" type="email" name="email" id="email" size="50" maxlength="250"



value="<?php echo $row->email;?>" />



</td>



</tr>


<tr>



<td width="100" align="right" class="key">



Send Email when Message Sent:


</td>


<td>

<?php
        $check0 = "";
        $check1 = "";
        if ($row->want_email == 0)
            $check0 = ' checked="checked" ';
        if ($row->want_email == 1)
            $check1 = ' checked="checked" ';
?>

<input type="radio" name="want_email" id="want_email0" value="0"  <?php
        echo $check0;
?> />
    <label for="want_email0">No</label>
    <input type="radio" name="want_email" id="want_email1" value="1" <?php
        echo $check1;
?>   />
    <label for="want_email1">Yes</label>



</td>



</tr>



<tr>



<td align="right" class="key">



Category:



</td>



<td>



<?php



echo $lists['category_id'];



?>



</td>



</tr>



<tr>

<tr>



<td width="100" align="right" class="key">



Images



</td>



<td>



<div style=" position:absolute; width:1px; height:1px; top:0px; overflow:hidden">



<textarea id="tempimage" name="tempimage" class="mce_editable"></textarea><br />



</div>



<input class="text_area" type="hidden" name="image_url"
id="image_url" size="50" maxlength="250"
value="<?php echo $row->image_url;?>" />
<!------------------------------------------------------------------------------------->
<div id='sel_img'>
<?php
	$param_string="";

	$par_values=explode(";",$row->image_url);
	$t=0;
?>
<script type="text/javascript">
	par_images=new Array(<?php
	for($j=0;$j<count($par_values);$j++) 
		{
			if($par_values[$j]!="")
				{
					echo "'".addslashes(htmlspecialchars($par_values[$j]))."',";
				}
		}
	
	?>'');
</script>
<?php
	$image_url_list='';
	
	for($j=0;$j<count($par_values);$j++) 
		{
	if(strpos($par_values[$j],'http://')===0 or strpos($par_values[$j],'https://')===0)
				$fullhref=$par_values[$j];
				else
				$fullhref=JURI::root().$par_values[$j];
				
			if($par_values[$j]!="")
				{
				
			$image_url_list.='<a href="..'.DS.$par_values[$j].'" target="_blank"><img src="..'.DS.'index.php?option=com_spidercontacts&view=picture&format=raw&tmpl=component&url='.$fullhref.'&height=50" style="margin:8px;"/></a>';
				
					echo '<input style="width:200px;" id="sel_img_'.$j.'" onChange="Add(\'sel_img\')" value="'.$par_values[$j].'" />
					<input type="button" value="X" onClick="Remove('.$j.',\'sel_img\');" /><br />';
					

				}
			else
				{
					if($t==0)
						{
					$srt_images='';

					echo '<input style="width:200px;" id="sel_img_'.$j.'" onChange="Add(\'sel_img\')" value="" />
					<input type="button" value="X" onClick="Remove('.$j.',\'sel_img\');" /><br />';
	
							$t++;
						}
				}
				
		}
?>
</div><input type="hidden" name="param1" id="hid_sel_img" value="<?php echo $param_string; ?>" />

<a class="modal-button" title="Image" href="index.php?option=com_media&view=images&tmpl=component&e_name=tempimage" onclick="IeCursorFix(); return false;" rel="{handler: 'iframe', size: {x: 570, y: 400}}">Add Image</a><br />

<script type="text/javascript">
srt_images="<?php echo $srt_images ?>"; 
setTimeout("getImage('<?php echo $_SERVER['HTTP_HOST'].JURI::root(true).DS ?>')",500);
</script>

</td>
</tr>
<tr><td colspan="2" style="width:500px;">
<?php echo $image_url_list; ?>
</td></tr>


<!---------------------------------------------------------------------------------------->


<?php

for ($i=0, $n=count( $rows1 ); $i < $n; $i++)
{
$row1 = &$rows1[$i];
$par=explode("	",$row1->param);

for($k=0;$k<count($par);$k++)
{
if(isset($par[$k]) and $par[$k]!='')
{
echo "<tr>

<td width=\"100\" align=\"right\" class=\"key\">".htmlspecialchars($par[$k])."</td>";
?>
<td>
<div id='<?php echo "par_".htmlspecialchars($par[$k]); ?>'>
<?php
$param_string="";
$par_data=explode("par_",$row->param);

for($j=0;$j<count($par_data);$j++) 
{
$par1_data=explode("@@:@@",$par_data[$j]);
if($par1_data[0]==$par[$k])
$param_string=$par1_data[1];
}

	$par_values=explode("	",$param_string);
	$t=0;
	?>
<script type="text/javascript">
parameters0['<?php echo "par_".addslashes(htmlspecialchars($par[$k])); ?>']=new Array(<?php
for($j=0;$j<count($par_values);$j++) 
	{
		if($par_values[$j]!="")
			{
				echo "'".addslashes(htmlspecialchars($par_values[$j]))."',";
			}
	}
?>'');
</script>
<?php
	for($j=0;$j<count($par_values);$j++) 

		{

			if($par_values[$j]!="")

				{

					echo '<input type="text" style="width:200px;" id="inp_par_'.htmlspecialchars($par[$k])."_".$j.'" value="'.htmlspecialchars($par_values[$j]).'" onChange="Add(\'par_'.addslashes(htmlspecialchars($par[$k])).'\')" /><input type="button" value="X" onClick="Remove('.$j.',\''."par_".addslashes(htmlspecialchars($par[$k])).'\');" /><br />';

				}

			else

				{
					if($t==0)
						{
					echo '<input type="text" style="width:200px;" id="inp_par_'.htmlspecialchars($par[$k])."_".$j.'" value="" 					onChange="Add(\'par_'.addslashes(htmlspecialchars($par[$k])).'\')" /><input type="button" value="X" onClick="Remove('.$j.',\''."par_".addslashes(htmlspecialchars($par[$k])).'\');" /><br />';
							$t++;
						}
				}

		}

?>
</div><input type="hidden" name="param1" id="hid_<?php echo "par_".htmlspecialchars($par[$k]); ?>" />

</td>
</tr>
<?php
}
}
}
?>


<tr>
<td width="100" align="right" class="key">
Description:<input type="hidden" value="<?php echo $row->param; ?>" name="param" id="all_par_hid" />

<script type="text/javascript">
loadHids();
</script>

</td>
<td>



<?php



echo $editor->display('description', $row->description ,



'200%', '30', '40', '5' );



?>



</td>



</tr>



<tr>



<td width="100" align="right" class="key">



Order:



</td>



<td>



<?php



echo $lists['ordering'];



?>



</td>



</tr>







<tr>



<td width="100" align="right" class="key">



Published:



</td>



<td>



<?php



echo $lists['published'];



?>



</td>



</tr>





<?php



if($_REQUEST['task']!="add"){

?>

<?php } ?>



</table>


</fieldset>



<input type="hidden" name="id"



value="<?php echo $row->id; ?>" />



<input type="hidden" name="option"



value="<?php echo $option;?>" />


<input type="hidden" name="controller" value="contacts" />

<input type="hidden" name="task"



value="" />



<?php echo JHTML::_( 'form.token' ); ?>



</form>



<?php



}



function editCategory( $row, $lists, $option )

{


echo '<style>fieldset label,
fieldset span.faux-label
{
	float:none;
	display:inline;
	}
	fieldset input, fieldset textarea, fieldset select, fieldset img, fieldset button
	{
		float:none;
		}</style>';
$editor =& JFactory::getEditor();



JHTML::_('behavior.calendar');



?>



<form action="index.php" method="post"



name="adminForm" id="adminForm">

<script type="text/javascript">
Joomla.submitbutton = function(pressbutton) 
{

if ( pressbutton!='cancel' )
{
	if(document.adminForm.name.value=='')
	{
		alert('First Name is required.');
		document.adminForm.name.focus();
	}
	
	
	else 
		submitform(pressbutton);
}

	else 
		submitform(pressbutton);
}
</script>


<fieldset class="adminform">



<legend>Details</legend>





<table class="admintable">



<tr>



<td width="100" align="right" class="key">



Name:



</td>



<td>



<input class="text_area" type="text" name="name"



id="name" size="50" maxlength="250"



value="<?php echo htmlspecialchars($row->name);?>" />



</td>



</tr>



<tr>



<td width="100" align="right" class="key">



Description:



</td>



<td>



<?php



echo $editor->display('description', $row->description ,



'100%', '150', '40', '5' ) ;



?>



</td>



</tr>






<tr>



<td width="100" align="right" class="key">



Parameters</td>
<td>
<script type="text/javascript">
	par_images=new Array(<?php
	for($j=0;$j<count($par_values);$j++) 
		{
			if($par_values[$j]!="")
				{
					echo "'".addslashes(htmlspecialchars($par_values[$j]))."',";
				}
		}
	
	?>'');
</script>

<script type="text/javascript">

parameters0['sel1']=new Array(<?php

$par=explode("	",$row->param);

for($k=0;$k<=count($par);$k++)
{
if(isset($par[$k]) and $par[$k]!='')
echo "'".addslashes(htmlspecialchars($par[$k]))."',";
}

?>'');

</script>

<div id="sel1">
<?php
$k=0;
while($k<1000)
{
if(isset($par[$k]) and $par[$k]!=''){
echo '<input type="text" style="width:200px;" id="inp_sel1_'.$k.'" value="'.htmlspecialchars($par[$k]).'" onChange="Add(\'sel1\')" /><input type="button" value="X" onClick="Remove('.$k.',\'sel1\');" /><br />';
$k++;
}
else{
echo '<input type="text" style="width:200px;" id="inp_sel1_'.$k.'" value="" onChange="Add(\'sel1\')" /><input type="button" value="X" onClick="Remove('.$k.',\'sel1\');" /><br />';
$k=1000;
}
}
?>
</div><input type="hidden" name="param" id="hid_sel1" value="<?php echo $row->param;?>	" />
</td>
</tr>

<tr>



<td width="100" align="right" class="key">



Order:



</td>



<td>



<?php



echo $lists['ordering'];



?>



</td>



</tr>



<tr>



<td width="100" align="right" class="key">



Published:



</td>



<td>



<?php



echo $lists['published'];



?>



</td>



</tr>



</table>



</fieldset>



<input type="hidden" name="id"



value="<?php echo $row->id; ?>" />



<input type="hidden" name="controller"value="category" />



<input type="hidden" name="option"value="<?php echo $option;?>" />



<input type="hidden" name="task"value="" />



<?php echo JHTML::_( 'form.token' ); ?>



</form>



<?php



}

    
    
   
 function showContacts($option, &$rows, $controller, $lists, $pageNav)
      {
?>





<form action="index.php?option=com_spidercontacts&controller=contacts" method="post" id="adminForm" name="adminForm">



<table>



            <tr>



            <td align="left" width="50%">



                    <?php
        echo JText::_('Filter');
?>:



                    <input type="text" name="search" id="search" value="<?php
        echo $lists['search'];
?>" class="text_area" onchange="document.adminForm.submit();" />



                    <button onclick="this.form.submit();"><?php
        echo JText::_('Go');
?></button>



                    <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php
        echo JText::_('Reset');
?></button>



                </td>


<td align="right" width="50%">
 <input type="button" value="Export as CSV" onclick="window.location='components/com_spidercontacts/exportcsv.php'" />
</td>


                <td align="right" width="50%">



                    



                    <?php
        echo $lists['category_id'];
?>



                    



                </td>



                <td nowrap="nowrap">



                </td>



            </tr>



        </table>



<table class="adminlist">



<thead>



<tr>



    







<tr>



<th width="1%">



#



</th>



<th width="1%">


<input type="checkbox" name="toggle"



value="" onclick="checkAll(<?php
        echo count($rows);
?>);" />



</th>



<th class="title"><?php
        echo JHTML::_('grid.sort', 'First Name', 'first_name', $lists['order_Dir'], $lists['order']);
?></th>


<th class="title"><?php
        echo JHTML::_('grid.sort', 'Last Name', 'last_name', $lists['order_Dir'], $lists['order']);
?></th>



<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Category', 'categories.name', @$lists['order_Dir'], @$lists['order']);
?></th>



<th width="8%"><?php
        echo JHTML::_('grid.sort', 'Order', 'ordering', @$lists['order_Dir'], @$lists['order']);
?>&nbsp;<?php
        echo JHTML::_('grid.order', $rows);
?></a></th>



<th width="5%" nowrap="nowrap"><?php
        echo JHTML::_('grid.sort', 'Published', 'published', @$lists['order_Dir'], @$lists['order']);
?></th>



</tr>



</thead>



 <?php
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++)
          {
            $row =& $rows[$i];
            $checked   = JHTML::_('grid.id', $i, $row->id);
            $published = JHTML::_('grid.published', $row, $i);
            $link      = 'index.php?option=' . $option . '&task=edit&controller=contacts&cid[]=' . $row->id;
?>



<tr class="<?php
            echo "row$k";
?>">



<td>



<?php
            echo $pageNav->getRowOffset($i);
?>



</td>



<td>



<?php
            echo $checked;
?>



</td>



<td>



<a href="<?php
            echo $link;
?>">



<?php
            echo $row->first_name;
?></a>



</td>

<td>



<a href="<?php
            echo $link;
?>">



<?php
            echo $row->last_name;
?></a>



</td>



<td>



<?php
            echo $row->category;
?>



</td>
<td class="order">



<input type="text" name="order[]" size="5" value="<?php
            echo $row->ordering;
?>" class="text_area" style="text-align: center" />



            </td>



<td align="center">



<?php
            echo $published;
?>



</td>



</tr>



<?php
            $k = 1 - $k;
          }
?>



<tfoot><tr>



                            <td colspan="8">



                                <?php
        echo $pageNav->getListFooter();
?>



                            </td>



                            </tr></tfoot>



</table>

<input type="hidden" name="option"



value="<?php
        echo $option;
?>" />



<input type="hidden" name="task" value="" />



<input type="hidden" name="boxchecked" value="0" />

<input type="hidden" name="controller" value="contacts" />

<input type="hidden" name="filter_order" value="<?php
        echo $lists['order'];
?>" />



<input type="hidden" name="filter_order_Dir" value="<?php
        echo $lists['order_Dir'];
?>" />



<?php
        echo JHTML::_('form.token');
?>



</form>



<?php

///////// VIEW MESSAGE
      }
	 function viewMessage($option,$sender , $title,  $text ,$date , $name,  $category, $sender_phone, $sender_mail, $sender_cont_pref)
      {  
JHTML::_('behavior.modal'); 

?>
<form action="index.php?option=com_spidercontacts&controller=contacts" method="post" id="adminForm" name="adminForm">



<legend>A Message from <?php echo $sender ?> </legend>



<table class="admintable">
<tr>
<td width="40%" class="paramlist_key"><span class="editlinktip">&nbsp;</span></td>
<td class="paramlist_value"><b>Sender Details</b></td>
</tr>


<tr>



<td width="100" align="right" class="key">



Sender Phone:



</td>



<td>


<?php echo $sender_phone;?>



</td>



</tr>


<tr>



<td width="100" align="right" class="key">



Sender Email:



</td>



<td>


<?php echo $sender_mail;?>



</td>



</tr>


<tr>



<td width="100" align="right" class="key">



Sender Contact Preference:



</td>



<td>


<?php  echo $sender_cont_pref;?>



</td>



</tr>

<tr>
<td width="40%" class="paramlist_key"><span class="editlinktip">&nbsp;</span></td>
<td class="paramlist_value"><b>Message Details</b></td>
</tr>


<tr>



<td width="100" align="right" class="key">



To Contact:



</td>



<td>


<?php echo $name;?>



</td>



</tr>

<tr>



<td width="100" align="right" class="key">



Category:



</td>



<td>


<?php echo $category;?>



</td>



</tr>

<tr>



<td width="100" align="right" class="key">



Date:



</td>



<td>


<?php echo $date;?>



</td>



</tr>

<tr>



<td width="100" align="right" class="key">



Title:



</td>



<td>


<?php echo $title;?>



</td>



</tr>

<tr>



<td width="100" align="right" class="key">



Message:



</td>



<td>


<?php echo $text;?>



</td>



</tr>

</table>


<input type="hidden" name="task" value="" />

<input type="hidden" name="boxchecked" value="0" />

<input type="hidden" name="controller" value="messages" />

</form>


<?php
	  }

	  
    function showcategories($option, &$rows, $controller, $lists, $pageNav)
      {
?>










<form action="index.php?option=com_spidercontacts&controller=category" method="post" id="adminForm" name="adminForm">







<table>



    <tr>



                <td align="left" width="100%">



                    <?php
        echo JText::_('Filter');
?>:



                    <input type="text" name="search" id="search" value="<?php
        echo $lists['search'];
?>" class="text_area" onchange="document.adminForm.submit();" />



                    <button onclick="this.form.submit();"><?php
        echo JText::_('Go');
?></button>



                    <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php
        echo JText::_('Reset');
?></button>



                </td>



                <td nowrap="nowrap">



                    



                    <?php
        //echo $lists['state'];
?>



                </td>



            </tr></table>



            <table class="adminlist">



<thead>



<tr>



<th width="1%">



#



</th>



<th width="1%">



<input type="checkbox" name="toggle"



value="" onclick="checkAll(<?php
        echo count($rows);
?>);" />



</th>



<th class="title"><?php
        echo JHTML::_('grid.sort', 'Name', 'name', $lists['order_Dir'], $lists['order']);
?></th>



<th width="35%"><?php
        echo JHTML::_('grid.sort', 'Description', 'description', $lists['order_Dir'], $lists['order']);
?></th>



<th width="10%"><?php
        echo JHTML::_('grid.sort', 'Order', 'ordering', @$lists['order_Dir'], @$lists['order']);
?>&nbsp;<?php
        echo JHTML::_('grid.order', $rows);
?></a></th>



<th width="5%" nowrap="nowrap"><?php
        echo JHTML::_('grid.sort', 'Published', 'published', $lists['order_Dir'], $lists['order']);
?></th>



</tr>



</thead>



<?php
        //jimport('joomla.filter.output');
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++)
          {
            $row =& $rows[$i];
            $checked   = JHTML::_('grid.id', $i, $row->id);
            $published = JHTML::_('grid.published', $row, $i);
            $link      = 'index.php?option=' . $option . '&task=edit&controller=category&cid[]=' . $row->id;
?>



<tr class="<?php
            echo "row$k";
?>">



<td>



<?php
            echo $pageNav->getRowOffset($i);
?>



</td>



<td>



<?php
            echo $checked;
?>



</td>



<td>



<a href="<?php
            echo $link;
?>">



<?php
            echo $row->name;
?></a>



</td>







<td>



<?php
            echo $row->description;
?>



</td>



<td class="order">



<input type="text" name="order[]" size="5" value="<?php
            echo $row->ordering;
?>" class="text_area" style="text-align: center" />



            </td>



<td align="center">



<?php
            echo $published;
?>



</td>



</tr>



<?php
            $k = 1 - $k;
          }
?><tfoot><tr><td colspan="6">



                                <?php
        echo $pageNav->getListFooter();
?>



                            </td>



                            </tr></tfoot>



</table>


<input type="hidden" name="option" value="<?php
        echo $option;
?>" />



<input type="hidden" name="task" value="" />



<input type="hidden" name="controller" value="category" />



<input type="hidden" name="boxchecked" value="0" />



<input type="hidden" name="filter_order" value="<?php
        echo $lists['order'];
?>" />



<input type="hidden" name="filter_order_Dir" value="<?php
        echo $lists['order_Dir'];
?>" />



<?php
        echo JHTML::_('form.token');
?>



</form>


<?php
      }
    
    function showOptions($op_type)
      {
?>



<div style="background-color:#f6f6f6"> 
<table>
<tr><td  ALIGN="center">

<?php
        if ($op_type == "")
            $width = 100;
        else
            $width = 50;
?>
<a href="index.php?option=com_spidercontacts&amp;controller=options&op_type=global"><img src="components/com_spidercontacts/images/Global options.png"  ALT="Global Options"  style="padding:12px;"  width=<?php
        echo $width;
?> ><br>Global Options </a>
</td>
<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=options&op_type=styles"><img src="components/com_spidercontacts/images/Styles and colors.png"  ALT="Styles and colors.png"  style="padding:12px;"  width=<?php
        echo $width;
?> ><br>Styles and colors</a>
</td>
<td  ALIGN="center">
<a href="index.php?option=com_spidercontacts&amp;controller=options&op_type=message_options"><img src="components/com_spidercontacts/images/Message-Options.png"  ALT="Message-Options.png"  style="padding:12px;"  width=<?php
        echo $width;
?> ><br>Message Options</a>
</td>

</tr>
</table>

</div >

  



<?php
      }
   
    function showGlobal($option, $param_values, $controller, $op_type)
      {
?>
<br />
<form action="#" method="post" name="adminForm">
<fieldset class="adminform">
<div class="updated" style="font-size: 14px; color:red !important"><p><strong>Global Options is disabled in free version. If you need this functionality, you need to buy the commercial version.</strong></p></div>
<table width="80%">
  <tbody>
                <tr>   
<td width="100%" style="font-size:14px; font-weight:bold"><a href="http://web-dorado.com/spider-contacts-guide-step-1.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a><br>
This section allows you to configure the global options. <a href="http://web-dorado.com/spider-contacts-guide-step-5/spider-contacts-guide-step-5-1.html" target="_blank" style="color:blue; text-decoration:none;">More...</a><br>
If you want to customize to the global options of your website,than you need to buy a license</td>   
<td colspan="7" align="right" style="font-size:16px;">
  <a href="http://www.web-dorado.com/files/fromSpiderContactsJoomla.php" target="_blank" style="color:red; text-decoration:none;">
<img src="components/com_spidercontacts/images/header.png" border="0" alt="http://web-dorado.com/files/fromSpiderCatalogJoomla.php" width="215"><br>
Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
</a>
  </td>
        </tr>


  </tbody></table>
  <img src="components/com_spidercontacts/images/global_options.PNG">

</fieldset>
</form>


<?php
        echo JHTML::_('form.token');
?>






<?php
      
		  
		  }
	  function showMessageOptions ($option, $param_values, $controller, $op_type)
	  {
		  
		  
		  ?>
          

     <form action="#" method="post" name="adminForm">
<fieldset class="adminform">
<div class="updated" style="font-size: 14px; color:red !important"><p><strong>Style Options is disabled in free version. If you need this functionality, you need to buy the commercial version.</strong></p></div>
<table width="80%">
  <tbody>
                <tr>   
<td width="100%" style="font-size:14px; font-weight:bold"><a href="http://web-dorado.com/spider-contacts-guide-step-1.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a><br>
This section allows you to configure the Message options. <a href="http://web-dorado.com/spider-contacts-guide-step-5/spider-contacts-guide-step-5-6.html" target="_blank" style="color:blue; text-decoration:none;">More...</a><br>
If you want to customize the Message options of your website,than you need to buy a license</td>   
<td colspan="7" align="right" style="font-size:16px;">
  <a href="http://www.web-dorado.com/files/fromSpiderContactsJoomla.php" target="_blank" style="color:red; text-decoration:none;">
<img src="components/com_spidercontacts/images/header.png" border="0" alt="http://web-dorado.com/files/fromSpiderCatalogJoomla.php" width="215"><br>
Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
</a>
  </td>
        </tr>


  </tbody></table>
  <img src="components/com_spidercontacts/images/message_op.png">

</fieldset>
</form>


          
		  
<?php	  }
	  
    function showStyles($option, $param_values, $controller, $op_type)
      {
?>









     <form action="#" method="post" name="adminForm">
<fieldset class="adminform">
<div class="updated" style="font-size: 14px; color:red !important"><p><strong>Style Options is disabled in free version. If you need this functionality, you need to buy the commercial version.</strong></p></div>
<table width="80%">
  <tbody>
                <tr>   
<td width="100%" style="font-size:14px; font-weight:bold"><a href="http://web-dorado.com/spider-contacts-guide-step-1.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a><br>
This section allows you to configure the Style options. <a href="http://web-dorado.com/spider-contacts-guide-step-5/spider-contacts-guide-step-5-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a><br>
If you want to customize to the global options of your website,than you need to buy a license</td>   
<td colspan="7" align="right" style="font-size:16px;">
  <a href="http://www.web-dorado.com/files/fromSpiderContactsJoomla.php" target="_blank" style="color:red; text-decoration:none;">
<img src="components/com_spidercontacts/images/header.png" border="0" alt="http://web-dorado.com/files/fromSpiderCatalogJoomla.php" width="215"><br>
Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
</a>
  </td>
        </tr>


  </tbody></table>
  <img src="components/com_spidercontacts/images/styles.png">

</fieldset>
</form>







<?php
      }
   
   
 


 function showMessages($option, &$rows, $controller, $lists, $cat_lists, $pageNav)
      {


?>



<form action="index.php?option=com_spidercontacts&controller=messages" method="post" id="adminForm" name="adminForm">



<table>



            <tr>



            <td align="left" width="50%">



                    <?php
        echo JText::_('Filter');
		JHTML::_('behavior.calendar');
		
?>:




                    <input type="text" name="search" id="search" value="<?php
        echo $lists['search'];
?>" class="text_area" onchange="document.adminForm.submit();" />

 From: <?php echo JHTML::_('calendar', $lists['startdate'], 'startdate' , 'startdate' , '%Y-%m-%d'); ?>

 

 To:    <?php echo JHTML::_('calendar', $lists['enddate'], 'enddate' , 'enddate' , '%Y-%m-%d'); ?>




 
				
                    <button onclick="this.form.submit();"><?php
        echo JText::_('Go');
?></button>





                    <button onclick="document.getElementById('search').value=''; document.getElementById('enddate').value='';document.getElementById('startdate').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php
        echo JText::_('Reset');
?></button>



                </td>


<td align="right" width="50%">



                    



               
     <button onclick="document.getElementById('cat_search').value=0; document.getElementById('cont_search').value=0;this.form.submit();">Show All Mesages</button>




                    



                </td>

                <td align="right" width="50%">



                    



                    <?php
        echo $lists['to_contact'];
?>



                    



                </td>
                   <td align="right" width="50%">



                    



                    <?php
        echo $cat_lists['to_category'];
?>



                    



                </td>



                <td nowrap="nowrap">



                </td>



            </tr>



        </table>



<table class="adminlist">



<thead>



<tr>



    







<tr>



<th width="1%">



#



</th>



<th width="1%">


<input type="checkbox" name="toggle"



value="" onclick="checkAll(<?php
        echo count($rows);
?>);" />



</th>


<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Message Title', '`title`', @$lists['order_Dir'], @$lists['order']);
?></th>

<th class="title"><?php
        echo JHTML::_('grid.sort', 'Name', '`first_name`', @$lists['order_Dir'], @$lists['order']);
?></th>

<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Sender Name', '`sender`', @$lists['order_Dir'], @$lists['order']);
?></th>

<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Sender Phone', '`phone`', @$lists['order_Dir'], @$lists['order']);
?></th>

<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Sender Email', '`email`', @$lists['order_Dir'], @$lists['order']);
?></th>

<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Contact Preferences with Sender', '`cont_pref`', @$lists['order_Dir'], @$lists['order']);
?></th>



<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Category', '`name`', @$lists['order_Dir'], @$lists['order']);
?></th>


<th width="12%"><?php
        echo JHTML::_('grid.sort', 'Date', '`date`', @$lists['order_Dir'], @$lists['order']);
?></th>











</tr>



</thead>



 <?php
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++)
          {
            $row =& $rows[$i];
            $checked   = JHTML::_('grid.id', $i, $row->id);
            $link      = 'index.php?option=' . $option . '&task=view&controller=messages&cid[]='.$row->id.'';
if ($row->readen == 1)
	$td_readen = ' style="background-color:#D3D3D3;"  ';
	else $td_readen = ' style="font-weight:bold; font-size:12px;"';

?>



<tr  class="<?php
            echo "row$k";
?>">



<td <?php echo $td_readen?> >



<?php
            echo $pageNav->getRowOffset($i);
?>



</td>



<td <?php echo $td_readen?> >



<?php
            echo $checked;
?>



</td>


<td <?php echo $td_readen?> >


<a href="<?php echo $link;?>">
<?php
            echo $row->title;
?></a>



</td>



<td <?php echo $td_readen?> >



<div>
<?php
            echo ''.$row->first_name.' '.$row->last_name.'';
?></div>



</td>


<td <?php echo $td_readen?> >



<?php			
            echo $row->sender;
?>



</td>

<td <?php echo $td_readen?> >





<?php
            echo $row->phone;
?>



</td>


<td <?php echo $td_readen?> >



<?php			
            echo $row->email;
?>



</td>

<td <?php echo $td_readen?> >



<?php			
            echo $row->cont_pref;
?>



</td>



<td <?php echo $td_readen?> >



<?php
            echo $row->name;
?>



</td>

<td <?php echo $td_readen?> >



<?php
            echo $row->date;
?>



</td>











</tr>



<?php
            $k = 1 - $k;
          }
?>

	

<tfoot><tr>



                            <td colspan="10">



                                <?php
        echo $pageNav->getListFooter();
?>



                            </td>



                            </tr>
                            </tfoot>



</table>






<input type="hidden" name="task" value="" />

<input type="hidden" name="boxchecked" value="0" />

<input type="hidden" name="controller" value="messages" />

<input type="hidden" name="filter_order" value="<?php
        echo $lists['order'];
?>" />



<input type="hidden" name="filter_order_Dir" value="<?php
        echo $lists['order_Dir'];
?>" />


</form>

<?php
        echo JHTML::_('form.token');
	  }}
?>












